package com.yxy.f_music_server.mapper;

import com.github.pagehelper.Page;
import com.yxy.f_music_server.domain.dto.SongPageQueryDTO;
import com.yxy.f_music_server.domain.po.Song;
import com.yxy.f_music_server.domain.vo.SongPageQueryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface MusicMapper {
    /**
     * 根据标题查询歌曲
     * @param title
     * @return
     */
    @Select("select * from music where title = #{title}")
    Song getByTitle(String title);

    /**
     * 添加歌曲
     * @param song
     */
    void add(Song song);

    /**
     * 获取歌曲列表
     * @param songPageQueryDTO
     * @return
     */
    Page<SongPageQueryVO> getMusicList(SongPageQueryDTO songPageQueryDTO);
}
